<?php
/*
	Aurus CMS - free OOP CMS
	Copyright (C) 2010  Nestor Yanchuk

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$err = false;
if (phpversion() < 5) {
	$err = true;
	$error[] = __('Версія PHP застара, оновіть PHP');
}
$needleExt = array('date','gd','mbstring','mysql','pcre','session','sockets');

$table = '';
foreach ($needleExt as $ext) {
	if (extension_loaded($ext)) {
		$table .= Html::tr(
		Html::td($ext).
		Html::td('<span style="color:green">'.__("Розширення встановлене.").'</span>')
		);

	} else {
		$err = true;
			$error[] = format(__("Розширення `{%1%}` не встановлене."),$ext);
			$table .= Html::tr(
		Html::td($ext).
		Html::td('<span style="color:red">'.__("Розширення не встановлене.").'</span>')
		);

	}
}

$c = '<h2>'.__('Перевірка на наявність необхідних модулів').'</h2>'.Html::table($table);

if ($err) {
	$c .= '<br /><span style="color:red">'.implode("<br />",$error).'</span>';
}
$c .= '<br /><span style="color:green">'.__('Ви можете встановлювати Aurus').'</span><br /><a href="'.LINK_ROOT.'install/index.php?step=3">'.__('Далі').'</a>';

echo HEADER.$c.FOOTER;